        var yzphone = true;
        var yzemail = true;
        $('input[name="phone"]').focusout(function(){
                //手机号必须以13,15,17,18,145,或147开头,并且11位数字,
                var patrn = /^0?(13[0-9]|15[0-9]|18[0-9]|17[0-9]|14[57])[0-9 ]{8}$/;
                var s = $(this).val();
                if (!patrn.exec(s) && !($(this).val()=='')){
                    $('#phone').css('display','block');
                    yzphone = 0;
                }else{
                    $('#phone').css('display','none');
                    yzphone = 1;
                }
            
        });
            $('input[name="email"]').focusout(function(){
                if($(this).val!=''){
                    //数字字母下划线@数字字母下划线,点,然后2-3位字符
                    var patrn = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
                    var s = $(this).val();
                    if (!patrn.exec(s) && !($(this).val()=='')){
                        $('#email').css('display','block');

                        yzemail = 0;
                    }else{
                        $('#email').css('display','none');
                        yzemail = 1;
                    }
                }
            });
        
        $('#tijiao').click(function(){
            var name = $('input[name="name"]').val();
            var sex = $('input[name="sex"]:checked').val();
            var age = $('input[name="age"]').val();
            var hobby = $('input[name="hobby"]').val();
            var phone = $('input[name="phone"]').val();
            var email = $('input[name="email"]').val();
            var blog = $('input[name="blog"]').val();
            var introduce = $('textarea[name="introduce"]').val();
            if(yzemail && yzphone){
                $.ajax({
                    url:'/admin/user/personal/update',
                    type:'post',
                    data:{'name':name,'sex':sex,'age':age,'hobby':hobby,'phone':phone,'email':email,'blog':blog,'introduce':introduce},
                    success:function(mes){
                         if(mes=='yes'){
                                $('#lvjing').css('display','block');
                                $("#tishi").css('display','block');
                                $("#tishi").html('<span style="color:green">修改成功,1秒后自动关闭</span>');
                                setTimeout(function(){
                                    $('#lvjing').css('display','none');
                                    $("#tishi").css('display','none');
                                },1000);
                            }else{
                                $('#lvjing').css('display','block');
                                $("#tishi").css('display','block');
                                $("#tishi").html('<span style="color:red;">修改失败,1秒后自动关闭</span>');
                                setTimeout(function(){
                                    $('#lvjing').css('display','none');
                                    $("#tishi").css('display','none');
                                },1000);
                            }
                            myajax();
                    }
                }); 
            }
            return false;
        });
    myajax();
    function myajax(){
        $.ajax({
            url:'/admin/user/personal/sel',
            type:'post',
            dataType:'json',
            success:function(mes){
                var sex = null;
                if($(mes).attr('sex')==1){
                    sex='男';
                }else{
                    sex='女';
                }
                var mydate = new Date();
                var dangqianshijian = mydate.getFullYear();
                var shengrishijian = parseInt($(mes).attr('age').split('/')['2']);
                var age = dangqianshijian-shengrishijian;
                $('.span10').find('li:eq(0)').find('span:eq(1)').html($(mes).attr('name'));
                $('.span10').find('li:eq(1)').find('span:eq(1)').html(sex);
                $('.span10').find('li:eq(2)').find('span:eq(1)').html(age);
                $('.span10').find('li:eq(3)').find('span:eq(1)').html($(mes).attr('age'));
                $('.span10').find('li:eq(4)').find('span:eq(1)').html($(mes).attr('hobby'));
                $('.span10').find('li:eq(5)').find('span:eq(1)').html($(mes).attr('phone'));
                $('.span10').find('li:eq(6)').find('span:eq(1)').html($(mes).attr('email'));
                $('.span10').find('li:eq(7)').find('span:eq(1)').html('<a href="http://'+$(mes).attr('blog')+'">'+$(mes).attr('blog')+'</a>');
                $('.span10').find('li:eq(8)').find('span:eq(1)').html($(mes).attr('introduce'));
                $('input[name="name"]').val($(mes).attr('name'));
                $('input[name="sex"][value="'+$(mes).attr('sex')+'"]').attr('checked','checked');
                $('input[name="age"]').val($(mes).attr('age'));
                $('input[name="hobby"]').val($(mes).attr('hobby'));
                $('input[name="phone"]').val($(mes).attr('phone'));
                $('input[name="email"]').val($(mes).attr('email'));
                $('input[name="blog"]').val($(mes).attr('blog'));
                $('textarea[name="introduce"]').val($(mes).attr('introduce'));
                $('#images').attr('src',$(mes).attr('pic'));
                $('#touxiang').attr('src',$(mes).attr('pic'));
                $('img[info="pic"]').attr('src',$(mes).attr('pic'));
                $('span[info="name"]').html($(mes).attr('name'));
            }
        });
    }

    function fun(mes){
        if(mes=='yes'){
            $('#lvjing').css('display','block');
            $("#tishi").css('display','block');
            $("#tishi").html('<span style="color:green">修改成功,1秒后自动关闭</span>');
            setTimeout(function(){
                $('#lvjing').css('display','none');
                $("#tishi").css('display','none');
            },1000);
        }else{
            $('#lvjing').css('display','block');
            $("#tishi").css('display','block');
            $("#tishi").html('<span style="color:red;">修改失败,1秒后自动关闭</span>');
            setTimeout(function(){
                $('#lvjing').css('display','none');
                $("#tishi").css('display','none');
            },1000);
        }
        myajax();
    }
    $('a[info="queren"]').click(function(){
        var curpassword = $('input[name="curpassword"]').val();
        var password = $('input[name="password"]').val();
        var repassword = $('input[name="repassword"]').val();
        $.ajax({
            url:'/admin/user/personal/edit',
            type:'post',
            data:{'curpassword':curpassword,'password':password,'repassword':repassword},
            success:function(mes){
                if(mes=='yes'){
                    $('#lvjing').css('display','block');
                    $("#tishi").css('display','block');
                    $("#tishi").html('<span style="color:green">修改成功,1秒后自动关闭</span>');
                    setTimeout(function(){
                        $('#lvjing').css('display','none');
                        $("#tishi").css('display','none');
                    },1000);
                }else{
                    $('#lvjing').css('display','block');
                    $("#tishi").css('display','block');
                    $("#tishi").html('<span style="color:red;">修改失败,1秒后自动关闭</span>');
                    setTimeout(function(){
                        $('#lvjing').css('display','none');
                        $("#tishi").css('display','none');
                    },1000);
                }
                $('input[name="curpassword"]').val('');
                $('input[name="password"]').val('');
                $('input[name="repassword"]').val('');
            }
        });
        return false;
    });